<?php 
include 'D:/dingjiangbbs/common/home.php';
//屏蔽notice错误
error_reporting(E_ALL ^ E_NOTICE);

//接收post传值
//var_dump($_POST);
$classname = $_POST['classname'];
$parentid  = $_POST['parentid'];

//将数据插入数据库
$table = DB_TABLE_CG;
$data  = [
	'parentid'   => $parentid,
	'classname'  => "$classname",	
	'classpic'   => 'image/tx.jpg',
	'orderby'    => 0,
	'replycount' => 0,
	'motifcount' => 0,
	'ispass'     => 1
];
//var_dump($data);

$res_add = insert($link,$table,$data);
//var_dump($res_add);

//输出,页面跳转
if (!$res_add) {
	exit('<a href="'.WEB_SITE.'admin_cg.php?bighead=3&cg_number=6">添加失败,返回继续</a>');
}
echo '<a href="'.WEB_SITE.'admin_cg.php?bighead=3&cg_number=5">添加成功,返回查看</a>';

mysqli_close($link);